<template>
	<view>
		<web-view :src="url" @message="handleMessage"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pdfUrl: "https://cdn.yicsucc.com/lawyer/contractpdf/医药商品买卖合同@9ea286c6-6b8b-4e23-bb95-cda882d22dd1.pdf",
				fileObj: {},
				
			};
		},
		onLoad(params) {
			this.fileObj = params
			console.log(params)
			this.getReviewDetail()
			
		},
		methods: {
			getReviewDetail() {
				uni.showLoading()
				this.$api.getReviewDetail({
					reviewId: this.fileObj.id
				}).then(res => {
					console.log(res.data.data);
					uni.hideLoading()
					if (res.data.code == 0) {
						this.content = res.data.data.resultContent
						let links = decodeURIComponent(this.fileObj.fileUrl);
						this.url = `/hybrid/html/test.html?url=${links}&content=${decodeURIComponent(this.content)}&title=${decodeURIComponent(this.fileObj.showFileName)}`;
					}
				})
			},
			handleMessage(e){
				console.log(e.detail.data);
				if(e.detail.data[0].copy){
					this.copyText(this.content)
				}
			}
		},

	}
</script>

<style lang="scss">

</style>